<template>
    <div>
        name: {{name}}
        <br />
        <input :value="name" @change="handleChange"/>
        <br />
        <button @click="handleClick">重置成功</button>
    </div>
</template>

<script>
    export default {
        name: 'Event',
        props: {
            name: String
        },
        methods: {
            handleChange(e) {
                this.$emit('change',e.target.value);
            },
            handleClick() {
                 this.$emit('change',"");
            }
        }
    }
</script>

<style lang="scss" scoped>

</style>